<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Document</title>
    <style></style>
  </head>
  <body>
    <div>
      <h1>堆栈中的JS执行过程</h1>
      <div>
        <h2>堆栈中代码执行流程</h2>
        <p>1.堆内存由GC垃圾回收机制回收</p>
        <p>2.栈内存由js主线程回收</p>
      </div>
    </div>
    <script>
      //代码片段一
      let a = 10;
      function foo(b) {
        let a = 2;
        function baz(c) {
          console.log(a + b + c);
        }
        return baz;
      }
      let fn = foo(2);
      fn(3);
    </script>
  </body>
</html>
